import { createRouter, createWebHistory } from 'vue-router'
import AdminLayout from '@/views/admin/AdminLayout.vue'
import StudentManagement from '@/views/admin/user/StudentManagement.vue'
import TeacherManagement from '@/views/admin/user/TeacherManagement.vue'
import CollegeManagement from '@/views/admin/organization/CollegeManagement.vue'
import MajorManagement from '@/views/admin/organization/MajorManagement.vue'
import ClassManagement from '@/views/admin/organization/ClassManagement.vue'

const routes = [
  {
    path: '/admin',
    component: AdminLayout,
    children: [
      // 用户管理
      {
        path: 'students',
        name: 'StudentManagement',
        component: StudentManagement
      },
      {
        path: 'teachers',
        name: 'TeacherManagement',
        component: TeacherManagement
      },
      // 组织管理
      {
        path: 'colleges',
        name: 'CollegeManagement',
        component: CollegeManagement
      },
      {
        path: 'majors',
        name: 'MajorManagement',
        component: MajorManagement
      },
      {
        path: 'classes',
        name: 'ClassManagement',
        component: ClassManagement
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router